package com.gexin.model.activity;

import com.gexin.model.activity.base.BaseGeneralIntegralSpeedRule;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * 业务名称:  t_general_integral_speed_rule() 
 */
@SuppressWarnings("serial")
public class


GeneralIntegralSpeedRule extends BaseGeneralIntegralSpeedRule<GeneralIntegralSpeedRule> {
	public static final GeneralIntegralSpeedRule dao = new GeneralIntegralSpeedRule();


	public GeneralIntegralSpeedRule getAllIntegralRule(){
		GeneralIntegralSpeedRule generalIntegralSpeedRule = GeneralIntegralSpeedRule.dao.findFirst("select * from t_general_integral_speed_rule");
		return generalIntegralSpeedRule;
	}
	public List<GeneralIntegralSpeedRule> getGeneralIntegralSpeedRule(){
		List<GeneralIntegralSpeedRule> all = dao.findAll();
		return all;
	}
	public static Boolean insertGeneralIntegralSpeedRule(Integer integralCountProportion, Integer integralUseProportion, Integer incrementProportion){
		GeneralIntegralSpeedRule generalIntegralSpeedRule = new GeneralIntegralSpeedRule();
		generalIntegralSpeedRule.setId(String.valueOf(UUID.randomUUID()));
		generalIntegralSpeedRule.setIntegralCountProportion(integralCountProportion);
		generalIntegralSpeedRule.setIntegralUseProportion(integralUseProportion);
		generalIntegralSpeedRule.setIncrementProportion(incrementProportion);
		long time = new Date().getTime();
		generalIntegralSpeedRule.setCreateTime(time);
		generalIntegralSpeedRule.setUpdatTime(time);
		Boolean flag = false;
		flag = generalIntegralSpeedRule.save();
		return flag;
	};
	public static Boolean deletGeneralIntegralSpeedRule(String id){
		return GeneralIntegralSpeedRule.dao.deleteById(id);
	}
}
